programming4us
           
 
 
SQL Server

SQL Server 2008 Scheduling and Notification : Managing Operators

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
6/26/2011 11:48:52 AM

Viewing the SQL Server Agent Error Log

The SQL Server Agent maintains an error log that records information, warnings, and error messages concerning its operation. A node named Error Logs is located in the SQL Server Agent tree in the Object Explorer. The Error Logs node contains multiple versions of the SQL Server Agent error log. By default, a maximum of 10 versions of the error log are displayed under the Error Logs node. The versions displayed include the current error log and the last 9 versions. Each time the SQL Server Agent is restarted, a new error log is generated, with a name that includes a time stamp. The first part of the current version’s name is Current. Names of older logs start with Archive #, followed by a number; the newer logs have lower numbers. The SQL Server error log works in much the same way as the SQL Server Agent’s error log.

Tip

You can cycle the error log at any time without stopping and starting the SQL Server Agent. To do so, you right-click the Error Logs node in the Object Explorer and select Recycle; a new error log is then generated. You can also use the msdb.dbo.sp_cycle_agent_errorlog stored procedure to cycle the error log. You need to remember to also select the Refresh option to show the latest available error logs.


To view the contents of any of the logs, you need to double-click the particular log. Double-clicking a particular log file launches the Log File Viewer. The Log File Viewer contains the SQL Server Agent error logs in addition to logs that are associated with other SQL Server components, including Database Mail, SQL Server, and Windows NT. Figure 1 shows a sample Log File Viewer screen with the current SQL Server Agent error log selected for display. The Log File Viewer provides filtering capabilities that allow you to focus on a particular type of error message, along with other viewing capabilities that are common to all the logs available for viewing.

Figure 1. The SQL Server Agent error log.


SQL Server Agent Security

Many changes were made to the security model related to the SQL Server Agent in SQL Server 2005. In the past, everyone could view the SQL Server Agent. Starting in SQL Server 2005, logins must be a part of the sysadmin server role or assigned to one of three msdb database roles to be able to view and modify the SQL Server Agent. The SQL Server Agent node does not appear in the Object Explorer tree if the login does not have the appropriate permissions. Following are the msdb database roles and their basic permissions:

  • SQLAgentUserRole— Users with this permission can create and manage local jobs and job schedules that they own. They cannot create multiserver jobs or manage jobs that they do not own.

  • SQLAgentReaderRole— Users with this permission can view jobs that belong to other users in addition to all the permissions associated with SQLAgentUserRole.

  • SQLAgentOperatorRole— Users with this permission can view operators and alerts and control jobs owned by other users. The job control on jobs owned by other users is limited to stopping or starting and enabling or disabling those jobs. SQLAgentOperatorRole also has all the permissions available to SQLAgentUserRole and SQLAgentReaderRole.

SQLAgentUserRole has the fewest privileges, and each subsequent role has increasing levels of security. In addition, each subsequent role inherits the permissions of the roles with fewer permissions. For example, SQLAgentReaderRole can do everything that SQLAgentUserRole can do and more. Refer to the topic “Implementing SQL Server Agent Security” in SQL Server Books Online for a detailed list of all the permissions related to the new database roles.

Managing Operators

Operators are accounts that can receive notification when an event occurs. These accounts are not linked directly to the user and login accounts that are defined on the server. They are basically aliases for people who need to receive notification based on job execution or alerts. Each operator can define one or more electronic means for notification, including email, pager, and the NET SEND command.

To add a new operator, you expand the SQL Server Agent node in the Object Explorer and right-click the Operators node. Then you select New Operator from the right-click menu. Figure 2 shows the New Operator screen, with many of the fields populated for the creation of a new operator named LauraG.

Figure 2. Creating a new operator.

The General page of the New Operator screen allows you to enter the name of the operator, the notification options, and the “on duty” scheduled for the operator. The operator name can be any name, but it must be unique within the SQL Server instance and must be no more than 128 characters. The operator name can be the same as another login or user on the server, but this is not required.

The notifications options are the key to operators. You create operators so that you can then define notification options and have messages sent from SQL Server.

If you use the email notification option, the email address you specify must be a valid address that can be reached via Database Mail or SQL Mail. One of the two mail options must be configured before the email functionality will work. If Database Mail is configured, the email is sent via an SMTP server. To send email with SQL Mail, SQL Server must be able to access a Microsoft Exchange server, and you must have the Extended MAPI client installed on the SQL Server machine.

The NET SEND notification option causes a pop-up window to appear on the recipient’s computer; this window contains the notification text. In the Net Send Address text box, you specify the name of the computer or user that is visible on the network to the SQL Server machine. For NET SEND to work, the Messenger service on SQL Server must be started. This Messenger service must also be started on the machine that is receiving the NET SEND message. You can test the basic NET SEND capabilities by executing NET SEND at the command prompt. The basic syntax for NET SEND follows:

NET SEND {name | * | /domain[:name] | /users} message

The following example uses the NET SEND command to send the message “Test net send message” to the operator LauraG:

NET SEND LauraG "Test net send message"

The final notification option is through a pager email address. Pager email requires that third-party software be installed on the mail server to process inbound email and convert it to a pager message. The methods for implementing pager email and the available software are dependent on the pager provider. You should contact your pager vendor for implementation details.

If you implement pager notification, you can also define the pager schedule for the operator. The Pager on Duty Schedule section of the New Operator dialog allows you to define the days and times when the operator will be available to receive a page. The General page includes a check box for each day the operator can receive a page. It also includes the Workday Begin and Workday End settings, which you can use to define the valid time periods to receive a page.

The other page available when defining a new operator is the Notifications page, which displays the alerts and jobs for which the operator will receive notifications. For a new operator, the Alert List or Job List is empty, as shown in Figure 3.

Figure 3. The Notifications page of the New Operator dialog.

You’ll have a better understanding of the usefulness of operators after you read the following discussions of jobs and alerts. Jobs and alerts can have operators linked to them for notification purposes.

Other -----------------
- SQL Server 2008 Scheduling and Notification : Configuring the SQL Server Agent
- SQL Server 2008 : Database Mail - Related Views and Procedures
- SQL Server 2008 : Database Mail - Using SQL Server Agent Mail
- SQL Server 2008 : Sending and Receiving with Database Mail
- SQL Server 2008 : Setting Up Database Mail
- SQL Server 2008 : Security and Compliance - Setting Up Auditing via T-SQL & SQL Injection Is Easy to Do
- SQL Server 2008 : Security and Compliance - SQL Server Auditing
- SQL Server 2008 : Security and Compliance
- SQL Server 2008 : Transparent Data Encryption
- SQL Server 2008 : Data Encryption - Column-Level Encryption
- SQL Server 2008 : Data Encryption - SQL Server Key Management
- SQL Server 2008 : Data Encryption
- SQL Server 2008 : Client Data Access Technologies
- SQL Server 2008 : Client Configuration
- SQL Server 2008 R2 : Client Installation
- SQL Server 2008 R2 : Client and Server Networking Considerations
- Upgrading to SQL Server 2008 : Upgrading Other SQL Server Components
- Upgrading to SQL Server 2008 : Slipstreaming Upgrades
- Upgrading to SQL Server 2008 : Upgrading Using a Configuration File
- Destination: SQL Server 2008 or SQL Server 2008 R2 (part 2) - Upgrading In-Place
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us